<template>
	<uv-popup ref="popupRef" round="20rpx" :closeOnClickOverlay="false">
		<view class="withdrawal-role-box">
			<view class="withdrawal-role-title">{{isPublic == '0' ? '对公提现说明' : '对私提现说明'}}</view>
			<view class="withdrawal-role-item">
				<text>单笔最低</text>
				<text>{{ruleInfo.singleMinAmount}}元</text>
			</view>
			<view class="withdrawal-role-item">
				<text>单笔最高</text>
				<text>{{ruleInfo.singleMaxAmount}}元</text>
			</view>
			<view class="withdrawal-role-item">
				<text>每月最高</text>
				<text>{{ruleInfo.monthMaxAmount}}元</text>
			</view>
			<view class="withdrawal-role-item">
				<text>每日提现笔数</text>
				<text>{{ruleInfo.daysMaxNumber}}笔</text>
			</view>
			<view class="withdrawal-role-item">
				<text>{{isPublic == '0' ? '开票税点' : '提现补缴税点'}}</text>
				<text>{{ruleInfo.singleTaxPoint}}%</text>
			</view>
			<view class="withdrawal-role-item">
				<text>提现单笔手续费</text>
				<text>{{ruleInfo.singleWithdrawFee}}元/笔</text>
			</view>
			<text class="withdrawal-role-desc-title">提现说明：</text>
			<text class="withdrawal-role-desc-text">{{remark}}</text>
			<view class="withdrawal-role-line"></view>
			<view class="bottom-box" @tap="close">我知道了</view>
		</view>
	</uv-popup>
</template>

<script setup>
	import { ref } from 'vue'
	const popupRef = ref(null)
	// 限额规则
	const ruleInfo = ref({
		singleMinAmount: 100,
		singleMaxAmount: 200,
		singleTaxPoint: 0.6,
		singleWithdrawFee: 6,
		daysMaxNumber: 3,
		monthMaxAmount: 2000,
		acctSettleType: "1",
		payType: "02",
		auditStatus: "0",
		ruleStatus: "1"
	})
	// 是否是对公，0：对公 1：对私
	const isPublic = ref('1')
	// 提现说明
	const remark = ref('')
	const open = (data,type,content) => {
		isPublic.value = type
		ruleInfo.value = data
		remark.value = content
		popupRef.value.open()
	}
	const close = () => {
		popupRef.value.close()
	}
	defineExpose({
		open
	})
</script>

<style lang="scss" scoped>
	.withdrawal-role-box {
		width: 600rpx;
		background-color: white;
		display: flex;
		flex-direction: column;
		padding: 30rpx;

		.withdrawal-role-title {
			text-align: center;
			font-size: 32rpx;
			margin-bottom: 40rpx;
		}

		.withdrawal-role-item {
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-top: 30rpx;
			font-size: 26rpx;

			text:nth-child(2) {
				color: $xh-color-6;
			}
		}

		.withdrawal-role-desc-title {
			margin-top: 30rpx;
		}

		.withdrawal-role-desc-text {
			margin-top: 20rpx;
			font-size: 24rpx;
			color: $xh-color-9;
		}

		.withdrawal-role-line {
			margin: 30rpx 0;
			background-color: $xh-line-color;
			height: 1px;
			transform: scaleY(0.5);
		}

		.bottom-box {
			color: $xh-theme-color;
			font-size: 30rpx;
			text-align: center;
		}
	}
</style>